//
//  ZSDate.m
//  PeonyDoctor
//
//  Created by peony on 16/3/18.
//  Copyright © 2016年 冷夜孤寒. All rights reserved.
//

#import "ZSDate.h"

@implementation ZSDate

+(NSString *)getCurrentTime {
    NSDate *date = [NSDate date];
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    
    [formatter setDateFormat:@"YYYY-MM-dd hh:mm:ss"];
    NSString *DateTime = [formatter stringFromDate:date];
    return DateTime;
}
+ (NSDate *)hyb_toDateWithTimeStamp:(NSString *)timeStamp {
    
    NSString * arg = timeStamp;
    if (![timeStamp isKindOfClass:[NSString class]]) {
        arg = [NSString stringWithFormat:@"%@", timeStamp];
    }
    NSTimeInterval time = [timeStamp doubleValue];
    return [NSDate dateWithTimeIntervalSince1970:time];
}
+(NSString *)dateConversionTime:(NSDate *)date {
    
    NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSString * dateStr = [dateFormatter stringFromDate:date];
    return dateStr;
}
+(NSString *)dateDayAndMonthYearConversionTime:(NSDate *)date{
    NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd"];
    NSString * dateStr = [dateFormatter stringFromDate:date];
    return dateStr;
}
@end
